package com.zerox.pojo;

import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Past;
import java.util.Date;

public class User {
    private Integer id;
    @NotEmpty(message = "账号不能为空")
    private String account;
    @NotEmpty(message = "姓名不能为空")
    private String realName;
    @NotEmpty(message = "密码不能为空")
    private String password;
    private Integer sex;
    @Past(message = "出生日期不能大于实际日期")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date birthday;
    @NotEmpty(message = "手机号码不能为空")
    private String phone;
    @NotEmpty(message = "用户地址不能为空")
    private String address;
    private Integer roleId;
    private Integer createdUserId;
    private Date createdTime;
    private Integer updatedUserId;

    private String idpicpath;//文件地址
    public User() {
    }

    public User(Integer id, String account, String realName, String password, Integer sex, Date birthday, String phone, String address, Integer roleId, Integer createdUserId, Date createdTime, Integer updatedUserId,String idpicpath) {
        this.id = id;
        this.account = account;
        this.realName = realName;
        this.password = password;
        this.sex = sex;
        this.birthday = birthday;
        this.phone = phone;
        this.address = address;
        this.roleId = roleId;
        this.createdUserId = createdUserId;
        this.createdTime = createdTime;
        this.updatedUserId = updatedUserId;
        this.setIdpicpath(idpicpath);
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public Integer getCreatedUserId() {
        return createdUserId;
    }

    public void setCreatedUserId(Integer createdUserId) {
        this.createdUserId = createdUserId;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Integer getUpdatedUserId() {
        return updatedUserId;
    }

    public void setUpdatedUserId(Integer updatedUserId) {
        this.updatedUserId = updatedUserId;
    }

    public String getIdpicpath() {
        return idpicpath;
    }

    public void setIdpicpath(String idpicpath) {
        this.idpicpath = idpicpath;
    }


}
